package com.neuedu.action.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neuedu.model.News;
import com.neuedu.service.NewsService;

@Controller
@RequestMapping("/newsXq")
public class NewsXqAction {
	@Autowired
	private NewsService NewsService;
	
	@RequestMapping(value = "/findOne")
	public String findAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
		int newsNo = Integer.parseInt(request.getParameter("newsNo"));

		News u = NewsService.findOne(newsNo);
		request.setAttribute("news", u);

		return "newsXq";
		
	}
}
